package com.tsunami.demo.controller;

import com.tsunami.authority.entity.auth.User;
import com.tsunami.base.R;
import com.tsunami.demo.provider.UserProvider;
import com.tsunami.log.annotation.SysLog;
import com.tsunami.user.annotation.LoginUser;
import com.tsunami.user.model.SysUser;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname HelloController
 * @Description TODO
 * @Date 2021-11-11 14:16
 * @Created by lx
 */
@RestController
public class HelloController {

    @Autowired
    private UserProvider userProvider;

    @GetMapping("/hello")
//    @SysLog("hello测试")
    public R hello(@LoginUser SysUser user) {
        System.out.println(user.getId());
        return userProvider.get();
    }

    @GetMapping("/ginfo")
//    @SysLog("hello测试")
    public R info(@LoginUser SysUser user) {
        System.out.println(user.getId());
        return userProvider.info(user.getId());
    }
}
